<template>
	<view v-if="dataList[0]">
		<view class="groupwork_box" v-if="parameter.layout == 1 || !parameter.layout" :style="{ '--color': vuex_config.themeColor1, '--price': vuex_config.price }">
			<view class="groupwork-box-item" v-for="(item, index) in dataList" :key="index" @click="goDetail(item)">
				<view class="item-left-img">
					<div class="sign">
						<div class="sign_num">{{ item.number || 2 }}人团</div>
						<image class="sign_img" src="http://klwl-file.oss-cn-shenzhen.aliyuncs.com/202104/admin/52256557795973.png"></image>
					</div>
					<image :src="item.logo"></image>
				</view>
				<view class="item-right-box">
					<text class="item-right-box-title">{{ item.name }}</text>
					<view class="box-price">
						<view class="price_item">
							<text class="box-price-icon">￥</text>
							<text class="box-price-title">{{ item.price }}</text>
						</view>
						<view class="price_item box-price-del" v-if="item.channlPrice">￥{{item.channlPrice}}</view>
					</view>
					<view class="item-right-box-price"><view class="box-price-btn">去拼团</view></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	components: {},
	props: {
		parameter: {
			type: Object,
			default: () => {
				return {};
			}
		},
		dataList: {
			type: Array,
			default: []
		}
	},
	data() {
		return {};
	},

	mounted() {},

	methods: {
		goDetail(item) {
			this.$toProd({ ...item, prodType: 10 });
		}
	}
};
</script>

<style scoped lang="scss">
.groupwork_box {
	padding: 4rpx 30rpx 28rpx;
	background-color: #fff;
}

.groupwork-box-item {
	padding: 20rpx;
	display: flex;
	box-shadow: 0rpx 4rpx 11rpx 2rpx rgba(153, 152, 152, 0.15);
	border-radius: 8rpx;
	margin-bottom: 28rpx;
	&:last-of-type {
		margin-bottom: 0;
	}
	.item-left-img {
		width: 260rpx;
		height: 230rpx;
		position: relative;
		margin-right: 18rpx;
		.sign {
			position: absolute;
			top: 0;
			left: -20rpx;
			width: 86rpx;
			height: 50rpx;
			.sign_num {
				width: 100%;
				position: absolute;
				left: 0;
				top: 0;
				text-align: center;
				line-height: 36rpx;
				color: #fff;
				font-size: 22rpx;
				text-align: center;
			}
		}
	}
	.item-right-box {
		flex: 1;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}
}

.item-right-box-title {
	text-overflow: -o-ellipsis-lastline;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	font-size: 30rpx;
	font-weight: 500;
	line-height: 44rpx;
	height: 88rpx;
	margin-top: 6rpx;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}
.box-price {
	.price_item {
		display: inline-block;
	}
	.box-price-icon {
		font-size: 26rpx;
		color: var(--price);
	}
	.box-price-title {
		color: var(--price);
		font-size: 36rpx;
		font-weight: bold;
	}
	.box-price-del {
		margin-left: 10rpx;
		text-decoration: line-through;
		font-size: 26rpx;
		color: #666666;
	}
}
.item-right-box-price {
	display: flex;
	align-items: center;
	flex-direction: row-reverse;
	padding-bottom: 10rpx;
	.box-price-btn {
		width: 126rpx;
		height: 46rpx;
		line-height: 46rpx;
		text-align: center;
		color: #fff;
		background-color: var(--color);
		border-radius: 22rpx;
		font-size: 26rpx;
	}
}
</style>
